package valueAndQuoteCross;

/**
 * @author shenmh
 * @create 2020-10-19 8:58
 * @description 引用传递
 */
public class QuoteCross {

    public static void main(String[] args) {
        Person p = new Person();
        p.setName("哪吒");
        p.setAge(4);
        quoteCross(p);
        System.out.println("方法执行后的person内容："+p.toString());

    }
    public static void quoteCross(Person person){
        System.out.println("传入的person的内容:"+person.toString());
        person = new Person();//新添加的代码
        person.setName("敖丙");
        person.setAge(15);
        System.out.println("方法内重新赋值后的person内容："+person.toString());
    }
}
